package com.wxzz.elearing.comment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.comment.entity.Skill;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 技能 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-05-17
 */
public interface SkillMapper extends BaseMapper<Skill> {

    @Select("SELECT user_id, COUNT(id) as watch_num FROM skill WHERE enterprise_id=#{enterpriseId} GROUP BY user_id ORDER BY watch_num DESC")
    List<Skill> getRank(@Param("enterpriseId") Long enterpriseId);

}
